<template>
    <div id="entrepot_detail">
      <div class="detail-table">
        <Row>
          <Col span="24" class="detail-table__col detail-table__title">仓库详情</Col>
        </Row>
        <Row>
          <Col span="12" class="detail-table__col">仓库名称：{{detailValue.whName}}</Col>
          <Col span="12" class="detail-table__col">仓库缩写：{{detailValue.whAbbr}}</Col>
        </Row>
        <Row>
          <Col span="24" class="detail-table__col">是否显示：{{detailValue.whStatus === 1 ? '显示' : detailValue.whStatus === 2 ? '隐藏': ''}}</Col>
        </Row>
        <Row>
          <Col span="24" class="detail-table__col">
            <table>
              <tr>
                <td width="72" valign="top">仓库简介：</td>
                <td>{{detailValue.remark}}</td>
              </tr>
            </table>
          </Col>
        </Row>
      </div>
    </div>
  </template>

<script>
import { entrepotDetail } from '@/api/purchase/index'
export default {
  name: 'entrepot_detail',
  data () {
    return {
      whCode: '',
      detailValue: {}
    }
  },
  methods: {
    getDetail () {
      entrepotDetail({
        merchantId: this.$store.state.user.merchantId,
        orgGuid: this.$store.state.user.orgId,
        whCode: this.whCode
      }).then(res => {
        const result = res.data || {}
        if (result.status === 200) {
          this.detailValue = result.data
        } else {
          this.$Message.error(result.error || result.message)
        }
      })
    }
  },
  mounted () {
    this.whCode = this.$route.params.whCode
    this.getDetail()
  }
}
</script>

<style lang="less">
@import '~@/assets/stylus/detail-table.less';
#entrepot_detail{
  padding: 40px 80px;
}
</style>
